package com.guoxin.chapter2.volatiletestthread;

/**
 * @author guoxin
 * @date 2019年8月21日
 */
public class MyThread extends Thread {
	public static volatile int num;

	private static synchronized void increaseNum() {
		for (int i = 0; i < 100; i++) {
			num++;
		}
		System.out.println("count=" + num);
	}

	@Override
	public void run() {
		increaseNum();
	}
}
